/* 
 * File:   Clases.h
 *
 * Created on 28 de julio de 2008, 12:51 AM
 */

#ifndef _CLASES_H
#define	_CLASES_H

#include <QString>
#include <QColor>

const int cartas[44]={ //0: Infanteria, 1: Caballeria, 2: Artilleria, 3: Comodin
    0,0,1,2,1,2,1,2,0,0,2,1,2,1,0,1,2,1,2,0,0,1,0,0,0,1,2,2,2,2,1,1,1,2,0,0,0,2,0,1,1,2,3,3
};
const int vecinos[42][6]={
    {2,6,26,-1,-1,-1},
    {1,6,7,9,-1,-1},
    {4,9,13,-1,-1,-1},
    {3,7,8,9,-1,-1},
    {6,7,8,15,-1,-1},
    {1,2,5,7,-1,-1},
    {2,4,5,6,8,9},
    {4,5,7,-1,-1,-1},
    {2,3,4,7,-1,-1},
    {11,12,-1,-1,-1,-1},
    {10,12,13,37,-1,-1},
    {10,11,13,-1,-1,-1},
    {3,11,12,-1,-1,-1},
    {15,16,17,20,-1,-1},
    {5,14,17,-1,-1,-1},
    {14,17,18,19,20,-1},
    {14,15,16,19,-1,-1},
    {16,19,20,27,35,37},
    {16,17,18,21,27,31},
    {14,16,18,37,-1,-1},
    {19,22,23,27,31,-1},
    {21,23,28,29,30,31},
    {21,22,27,29,-1,-1},
    {26,28,30,32,-1,-1},
    {28,26,-1,-1,-1,-1},
    {1,24,25,28,32,-1},
    {18,19,21,23,35,-1},
    {22,24,25,26,30,-1},
    {22,23,40,-1,-1,-1},
    {22,24,28,31,32,-1},
    {19,21,22,30,-1,-1},
    {24,26,30,-1,-1,-1},
    {34,37,38,-1,-1,-1},
    {33,35,36,37,38,-1},
    {18,27,34,37,-1,-1},
    {34,38,-1,-1,-1,-1},
    {11,18,20,33,34,35},
    {33,34,36,-1,-1,-1},
    {41,42,-1,-1,-1,-1},
    {29,41,42,-1,-1,-1},
    {39,40,42,-1,-1,-1},
    {39,40,41,-1,-1,-1},
};

const int continentes[6][12]={
    {0,1,2,3,4,5,6,7,8,-1,-1,-1},
    {9,10,11,12,-1,-1,-1,-1,-1,-1,-1,-1},
    {13,14,15,16,17,18,19,-1,-1,-1,-1,-1},
    {20,21,22,23,24,25,26,27,28,29,30,31},
    {32,33,34,35,36,37,-1,-1,-1,-1,-1,-1},
    {38,39,40,41,-1,-1,-1,-1,-1,-1,-1,-1},
};

const int refuerzosContinente[6]={5,2,5,7,3,2};
const QString nombreTerritorio[42]= {
    "Alaska",
    "Alberta",
    "America Central",
    "Estados Unidos del Este",
    "Groenlandia",
    "Territorios del Noroeste",
    "Ontario",
    "Quebec",
    "Estados Unidos del Oeste",
    "Argentina",
    "Brasil",
    "Peru",
    "Venezuela",
    "Gran Bretana",
    "Iceland",
    "Europa del Norte",
    "Escandinavia",
    "Europa del Sur",
    "Ucrania",
    "Europa Occidental",
    "Afghanistan",
    "China",
    "India",
    "Irkutsk",
    "Japon",
    "Kamchatka",
    "Oriente Medio",
    "Mongolia",
    "Siam",
    "Siberia",
    "Ural",
    "Yakutsk",
    "Congo",
    "Africa Oriental",
    "Egipto",
    "Madagascar",
    "Africa del Norte",
    "Sudafrica",
    "Australia Oriental",
    "Indonesia",
    "Nueva Guinea",
    "Australia Occidental"};
    

class Jugador{
public:
    int nEjercitos;
    int cartas[6],nCartas;
    bool jugando, asigno;
    QString nombre;
    QColor color;   // Creo que esta variable no hace falta
    void recibirCarta(int carta);
    int canjearCarta(int posCarta);
    void inicializar(int nEj, QString n, QColor c);
};

class Territorio{
public:    
    int nEjercitos, nJugador;
    QString nombre;
    QColor color;
    int listaVecinos[5];
    bool esVecino(int nTerritorio);
    void inicializar(int nTerritorio);
    bool asignar(int codJug, Jugador *jug);
    bool ocupar(int codJug, Jugador *jug);
    void conquistar(int codJug, QColor c);
};

class Mazo {
public:
    int mazo[44];
    int nCartas;
    int obtenerCarta();
    void devolverCarta(int carta);
    void barajar();
    Mazo();
};

#endif	/* _CLASES_H */

